package com.ucode.springboot.starter.ESsearch.annotation.metadata;

/**
 * DocEsMapping 注解解析的元数据
 * @author: liliang
 * @date: 2019年12月30日 下午8:13:16
 */
public class EsFieldData {

    /**
     * 字段名称
     */
    String fieldName;
    /**
     * 字段数据类型（包含 关键字类型）
     */
    String datatype;
    /**
     * 间接关键字
     */
    boolean keyword;
    /**
     * 是否开启doc_values
     */
    boolean docValues;
    /**
     * 关键字忽略字数
     */
    int ignoreAbove;
    /**
     * 是否支持ngram，高效全文搜索提示
     */
    boolean ngram;
    /**
     * 是否支持suggest，高效前缀搜索提示
     */
    boolean suggest;
    /**
     * 索引分词器设置
     */
    String analyzer;
    /**
     * 搜索内容分词器设置
     */
    String searchAnalyzer;
    /**
     * 是否允许被搜索
     */
    boolean allowSearch;
    /**
     * 拷贝到哪个字段，代替_all
     */
    String copyTo;

    String nullValue;
    
    Class nestedClass;
    
    public EsFieldData(){}

    public EsFieldData(String fieldName, String datatype, boolean keyword, boolean docValues, int ignoreAbove, boolean ngram, boolean suggest,
            String analyzer, String searchAnalyzer, boolean allowSearch, String copyTo, String nullValue, Class nestedClass) {
        super();
        this.fieldName = fieldName;
        this.datatype = datatype;
        this.keyword = keyword;
        this.docValues = docValues;
        this.ignoreAbove = ignoreAbove;
        this.ngram = ngram;
        this.suggest = suggest;
        this.analyzer = analyzer;
        this.searchAnalyzer = searchAnalyzer;
        this.allowSearch = allowSearch;
        this.copyTo = copyTo;
        this.nullValue = nullValue;
        this.nestedClass = nestedClass;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getDatatype() {
        return datatype;
    }

    public void setDatatype(String datatype) {
        this.datatype = datatype;
    }

    public boolean isKeyword() {
        return keyword;
    }

    public void setKeyword(boolean keyword) {
        this.keyword = keyword;
    }

    public boolean isDocValues() {
        return docValues;
    }

    public void setDocValues(boolean docValues) {
        this.docValues = docValues;
    }

    public int getIgnoreAbove() {
        return ignoreAbove;
    }

    public void setIgnoreAbove(int ignoreAbove) {
        this.ignoreAbove = ignoreAbove;
    }

    public boolean isNgram() {
        return ngram;
    }

    public void setNgram(boolean ngram) {
        this.ngram = ngram;
    }

    public boolean isSuggest() {
        return suggest;
    }

    public void setSuggest(boolean suggest) {
        this.suggest = suggest;
    }

    public String getAnalyzer() {
        return analyzer;
    }

    public void setAnalyzer(String analyzer) {
        this.analyzer = analyzer;
    }

    public String getSearchAnalyzer() {
        return searchAnalyzer;
    }

    public void setSearchAnalyzer(String searchAnalyzer) {
        this.searchAnalyzer = searchAnalyzer;
    }

    public boolean isAllowSearch() {
        return allowSearch;
    }

    public void setAllowSearch(boolean allowSearch) {
        this.allowSearch = allowSearch;
    }

    public String getCopyTo() {
        return copyTo;
    }

    public void setCopyTo(String copyTo) {
        this.copyTo = copyTo;
    }

    public String getNullValue() {
        return nullValue;
    }

    public void setNullValue(String nullValue) {
        this.nullValue = nullValue;
    }

    public Class getNestedClass() {
        return nestedClass;
    }

    public void setNestedClass(Class nestedClass) {
        this.nestedClass = nestedClass;
    }
}
